'''
	Andrew Oberlin
	Date Created: February 27, 2012
	Date Last Modified: February 27, 2012
'''
class SoundLoader:
	'''
		Creates the sound loader and begins to 
		load the sounds
	'''
	def __init__(self, parent):
		self.parent = parent
		self.music = dict()
		self.__loadSounds()
		
	'''
		Loads all the sounds needed for
		the game
	'''
	def __loadSounds(self):
		self.music['menu'] = self.parent.loader.loadSfx("sounds/main_menu.mp3")
		self.music['menu'].setVolume(0.75)
		self.music['menu'].setLoop(True)
		
		self.music['create_marine'] = self.parent.loader.loadSfx("sounds/marine_create.mp3")
		self.music['create_marine'].setVolume(0.75)
		self.music['create_marine'].setLoop(False)
		
		self.music['fire_gun'] = self.parent.loader.loadSfx("sounds/fire_gun.mp3")
		self.music['fire_gun'].setVolume(0.5)
		self.music['fire_gun'].setLoop(False)
		
		self.music['click'] = self.parent.loader.loadSfx("sounds/click.mp3")
		self.music['click'].setVolume(0.5)
		self.music['click'].setLoop(False)
		
	'''
		Plays the music for displaying the menu
	'''
	def playMusic(self, key):
		self.music[key].play()
		
	'''
		Stops the music that has been identified
	'''
	def stopMusic(self, key):
		self.music[key].stop()
		
	'''
		Stops playing all the music
	'''
	def stopAllMusic(self):
		for sound in self.music:
			sound.stop()